#ifndef ACTIONEVENT_H_
#define ACTIONEVENT_H_

#include <wx/event.h>
#include "../actions/Action.h"

namespace Impp{

enum ActionEventType
{
	ACTION_EVENT_NEW_ACTION,
	ACTION_EVENT_DELETE_ACTION,
	ACTION_EVENT_STATUS_CHANGED
};



class ActionEvent : public wxNotifyEvent
{

private:
	Action* action;
	ActionEventType actionEventType;

public:
	ActionEvent(Action* action, const ActionEventType & actionEventType, wxEventType eventType = wxEVT_NULL, int id = 0);
	virtual ~ActionEvent();

	virtual wxEvent* Clone()const;

	ActionId getActionId();
	Action* getAction();
	wxString getActionClassName();
	ActionEventType getActionEventType();

};

// ein Typedef auf die entsprechenden EventHandler
typedef void(wxEvtHandler::*ActionEventFunction)(ActionEvent&);

// wxWidgets den neuen Event mitteilen
BEGIN_DECLARE_EVENT_TYPES()
  DECLARE_EVENT_TYPE(EVT_ACTION, -1)
END_DECLARE_EVENT_TYPES()

// dieses #define sorgt daf�r das man den Event �ber den Makro EventTable einbinden kann
#define EVT_ACTION_MACRO(id, fn) DECLARE_EVENT_TABLE_ENTRY(               \
		EVT_ACTION, id, -1, (wxObjectEventFunction)               \
        (wxEventFunction)ActionEventFunction) & fn,                             \
        (wxObject*) NULL),

// dieses #define sorgt daf�r das man den Event auch �ber Connect verbinden kann
#define ActionEventHandler(func)                                                 \
        (wxObjectEventFunction)                                                \
        (wxEventFunction)wxStaticCastEvent(ActionEventFunction, &func)


}

#endif /*ActionEvent_H_*/
